<%= content_for :functions do %>
    <%= link_to span_tag("List All"), cms.email_messages_path, :class => "button" %>
<% end %>

<% use_page_title "Email Message" %>
<%= render layout: 'page_title' do %>
    <%= link_to "Email Messages", cms.email_messages_path, :class => "btn btn-primary right btn-small" %>
<% end %>

<%= render layout: 'main_with_sidebar' do %>
    <dl>
      <dt>Delivered At:</dt>
      <dd><%= time_on_date(@message.delivered_at) %></dd>
    </dl>

    <% unless @message.content_type.blank? %>
        <dl>
          <dt>Content-Type:</dt>
          <dd><%= h @message.content_type %></dd>
        </dl>
    <% end %>
    <dl>
      <dt>From:</dt>
      <dd><%= h @message.sender %></dd>
    </dl>
    <dl>
      <dt>To:</dt>
      <dd><%= h @message.recipients %></dd>
    </dl>
    <% unless @message.cc.blank? %>
        <dl>
          <dt>CC:</dt>
          <dd><%= h @message.cc %></dd>
        </dl>
    <% end %>
    <% unless @message.bcc.blank? %>
        <dl>
          <dt>BCC:</dt>
          <dd><%= h @message.bcc %></dd>
        </dl>
    <% end %>
    <dl>
      <dt>Subject:</dt>
      <dd><%= h @message.subject %></dd>
    </dl>
    <dl>
      <dt>Body</dt>
      <dd><%= h @message.body %></dd>
    </dl>
<% end %>
